package com.app.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.gyf.immersionbar.ImmersionBar;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created Date 2019/6/23.
 *
 * @author liangkun
 * ClassDescription：
 */
public class CoordActivity extends AppCompatActivity {
    @BindView(R.id.appbar)
    protected AppBarLayout appBarLayout;

//    @BindView(R.id.rv)
    protected RecyclerView recyclerView;
    private DemoRvAdapter singerRvAdapter;
    private List<String> data;

    @Override

    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_two);
        ImmersionBar.with(this).fitsSystemWindows(true).statusBarColor(R.color.color_FFB146).init();
        recyclerView=  findViewById(R.id.rv);
        data = getData();
        initView();
    }

    protected void initView() {
        LinearLayoutManager  layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        recyclerView.setLayoutManager(layoutManager);
        singerRvAdapter = new DemoRvAdapter(this,data);
        recyclerView.setAdapter(singerRvAdapter);
    }

    private List<String> getData() {
        List<String> strings = new ArrayList<>();
        for (int i = 0; i < 50; i++) {
            strings.add("我是 "+i);
        }
        return strings;
    }
}
